package com.universal_library.permission;

import android.content.Context;

/**
 * Created by solin on 2018/1/30.
 */

public class Acp {
    private Context mContext;
    private static Acp mInstance;
    private AcpManager mAcpManager;

    public Acp(Context mContext) {
        this.mContext = mContext;
        mAcpManager = new AcpManager(mContext);
    }

    /**
     * 返回 acp对象
     *
     * @param context
     * @return
     */
    public static synchronized Acp getmInstance(Context context) {
        if (mInstance == null) {
            mInstance = new Acp(context);
        }
        return mInstance;
    }

    public void request(AcpOptions options, AcpListener listener) {
        if (options == null)
            new NullPointerException("AcpOptions is null ..........");
        if (listener == null)
            new NullPointerException("Acplistener is null ..........");
        mAcpManager.request(options, listener);
    }

    public AcpManager getmAcpManager() {
        return mAcpManager;
    }
}
